/**
 * 
 */
package denaris.core.entity;

import denaris.core.AbstractDenarisMap;
import denaris.core.controller.AbstractController;
import denaris.core.controller.LooseSatelliteController;

/**
 * @author stkl23
 *
 */
public class LooseSatellite extends AbstractEntity {
	private static int SCORE = 500;
	private int type;
	
	public LooseSatellite(AbstractDenarisMap parentMap, int satelliteType) {
		super(parentMap, SCORE);
		setType(satelliteType);
	}

	/* (non-Javadoc)
	 * @see denaris.core.entity.AbstractEntity#createController()
	 */
	public AbstractController createController() {
		return new LooseSatelliteController();
	}

	/* (non-Javadoc)
	 * @see denaris.core.entity.AbstractEntity#onScopeLeft()
	 */
	public void onScopeLeft() {
		getParentMap().removeEnemy(this);
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public Explosion explode(int childExplosions, int frameDelay) {
		Explosion explosion = super.explode(childExplosions, frameDelay);
		explosion.setTurnToCollectible(false);
		explosion.setTurnToSatellite(getType());
		AbstractDenarisMap map = getParentMap();
		map.removeEnemy(this);
		map.addFriend(explosion);
		return explosion;
	}

}
